//
//  IndentViewController.m
//  ECO
//
//  Created by zl on 2019/10/12.
//  Copyright © 2019 谷银行. All rights reserved.
//

#import "IndentViewController.h"
#import "QuanBuViewController.h"
#import "JieSuanViewController.h"
#import "DaiJieSuanViewController.h"
#import "TuiKuanViewController.h"
@interface IndentViewController ()<XLSlideSwitchDelegate>
@property(nonatomic , strong)XLSlideSwitch *slideSwitch;
@property (nonatomic,strong)QuanBuViewController *base;
//@property (nonatomic,strong)NSMutableArray *titles;
@end

@implementation IndentViewController
//-(NSMutableArray *)titles{
//    if (!_titles) {
//        _titles = [[NSMutableArray alloc]init];
//    }
//    return _titles;
//}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"订单详情";
    self.view.backgroundColor = [UIColor whiteColor];
    [self createMenu];
}
- (void)createMenu {
    NSMutableArray *viewControllers = [NSMutableArray new];
    NSArray *titles = @[@"全部订单",@"结算订单",@"待结算订单",@"退款订单"];
//    NSArray *VCArr = @[@"QuanBuViewController",@"JieSuanViewController",@"DaiJieSuanViewController",@"TuiKuanViewController"];
//    for (int i=0; i<titles.count; i++) {
//        UIViewController *vc=[[NSClassFromString(VCArr[i]) alloc]init];
//        [viewControllers addObject:vc];
//    }
    for (int i=0; i<titles.count; i++) {
        //字符串创建控制器
        self.base = [QuanBuViewController new];
        self.base.page_index = self.Index;
        self.base.appUserId = self.appUserId;
        [viewControllers addObject:self.base];
    }
    //创建滚动视图
    _slideSwitch = [[XLSlideSwitch alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - 12) Titles:titles viewControllers:viewControllers];
    //设置代理
    _slideSwitch.delegate = self;
    //设置按钮选中和未选中状态的标题颜色
    _slideSwitch.itemSelectedColor = [UIColor colorWithHexString:@"#333333"];
    _slideSwitch.itemNormalColor = [UIColor colorWithHexString:@"#C8C8C8"];
    //标题横向间距
    _slideSwitch.customTitleSpacing = 30;
    //显示方法
    [_slideSwitch showInViewController:self];
    _slideSwitch.selectedIndex = self.Index.intValue;
}

@end
